# 导包
from selenium import webdriver
# 导入定位类，可以选择定位方式
from selenium.webdriver.common.by import By
from time import sleep
# 获取浏览器对象
driver = webdriver.Firefox()
# 打开注册页面registerA.html
url = 'file:///C:/Users/TEACHER/Desktop/NSD2405/html/registerA.html'
driver.get(url)
# 通过ID定位用户名输入框,并输入admin
username = driver.find_element(By.ID, 'userA')
username.send_keys('admin')
# 练习：通过ID定位密码、邮箱、电话，并输入对应内容
password = driver.find_element(By.ID, 'passwordA')
password.send_keys('123456')
tel = driver.find_element(By.ID, 'telA')
tel.send_keys('18812345678')
email = driver.find_element(By.ID, 'emailA')
email.send_keys('123@qq.com')

# 停顿3秒关闭浏览器驱动
sleep(3)
driver.quit()